Skip to content

[core][spark][flink] Fix nested data evolution isolation - #9564

Merged
JingsongLi merged 8 commits into
apache:masterfrom
JingsongLi:codex/fix-nested-data-evolution-p1
Sep 3, 2026
Merged

[core][spark][flink] Fix nested data evolution isolation#9564
JingsongLi merged 8 commits into
apache:masterfrom
JingsongLi:codex/fix-nested-data-evolution-p1

Conversation

@JingsongLi

@JingsongLi JingsongLi commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Purpose

Follow up #8334 so sub-field-level nested data evolution is completely opt-in and preserves legacy data-evolution behavior while disabled.

Changes

  • Gate nested path parsing, projection, conflict detection, read planning, and partial writes in Core, Flink, and Spark behind data-evolution.nested-field.enabled.
  • Preserve literal top-level column names containing dots and retain the legacy top-level write metadata encoding while the option is disabled.
  • Support both a persisted false-to-true rollout and per-operation enablement through dynamic table options. Dynamic enablement affects only the copied table instance and does not persist the option; persisted true-to-false changes or removal remain rejected, and data-evolution.enabled=true is required.
  • Preserve row cardinality and every ROW ancestor nullness for projected or newly added nested leaves.
  • Separate format reader mappings by requested shape, physical projected schema, and effective nested mode.
  • Detect persisted enablement from file schemas so readers retained across ALTER TABLE false-to-true safely read later nested partial files.
  • Inject the nested-field option into row-id column conflict detection instead of reading the latest schema inside the checker.

Compatibility

Upgrade every reader, writer, compactor, and maintenance component before enabling the option. Downgrading after nested sub-field metadata has been committed is unsafe.

Tests

  • Core targeted suite: 48 tests passed.
  • Conflict detection suite: 50 tests passed.
  • API option-aware TableSchema tests: 2 tests passed.
  • SchemaValidation and DataEvolutionUtils targeted tests: 4 tests passed.
  • Flink nested MERGE INTO integration suite: 14 tests passed.
  • Spark 3 nested MERGE INTO suite: 15 tests passed.
  • Spark 4 module compiled with JDK 17.
  • Spotless checks passed for all changed modules.

@leaves12138 leaves12138 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the Core, Flink, and Spark changes, including option gating, nested read planning, nullness preservation, conflict detection, compaction/global-index paths, and partial-write handling. Targeted tests passed; three local compaction-test errors were caused by CodeGenerator service discovery in the local test environment rather than assertion failures. No blocking issue found.

@JingsongLi
JingsongLi merged commit 46ba090 into apache:master Sep 3, 2026
14 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants